//
//  EditScoreViewController.h
//  ScorePad
//
//  Created by Andy on 22/08/2010.
//  Copyright 2010 Mister Smith's Maevellous Mechanical Software Company. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol EditScoreViewDelegate;

@interface EditScoreViewController : UIViewController <UITextFieldDelegate>{
	
	id <EditScoreViewDelegate> delegate;

	NSArray *oneHand;
	NSArray *playerNames;
	NSNumber *numberOfPlayers;
	
	UILabel *name0;
	UITextField *score0;
	UILabel *name1;
	UITextField *score1;
	UILabel *name2;
	UITextField *score2;
	UILabel *name3;
	UITextField *score3;
	UILabel *name4;
	UITextField *score4;
	UILabel *name5;
	UITextField *score5;
	UILabel *name6;
	UITextField *score6;
	
	UITextField *activeField;
		
	BOOL keyboardShown;
	BOOL isNumberValid;
		
}

@property (nonatomic, assign) id<EditScoreViewDelegate> delegate; 

@property (nonatomic, retain) NSArray *oneHand;
@property (nonatomic, retain) NSArray *playerNames;
@property (nonatomic, retain) NSNumber *numberOfPlayers;

@property (nonatomic, retain) IBOutlet UILabel *name0;
@property (nonatomic, retain) IBOutlet UITextField *score0;
@property (nonatomic, retain) IBOutlet UILabel *name1;
@property (nonatomic, retain) IBOutlet UITextField *score1;
@property (nonatomic, retain) IBOutlet UILabel *name2;
@property (nonatomic, retain) IBOutlet UITextField *score2;
@property (nonatomic, retain) IBOutlet UILabel *name3;
@property (nonatomic, retain) IBOutlet UITextField *score3;
@property (nonatomic, retain) IBOutlet UILabel *name4;
@property (nonatomic, retain) IBOutlet UITextField *score4;
@property (nonatomic, retain) IBOutlet UILabel *name5;
@property (nonatomic, retain) IBOutlet UITextField *score5;
@property (nonatomic, retain) IBOutlet UILabel *name6;
@property (nonatomic, retain) IBOutlet UITextField *score6;

@property (nonatomic, retain) IBOutlet UITextField *activeField;

- (void)registerForKeyboardNotifications;
- (void)scrollActiveTextFieldIntoView:(UITextField *)textField;
- (void)horribleHidingMethod;
- (UIView *)numericKeyboardView;

@end

@protocol EditScoreViewDelegate <NSObject>

@optional
- (void)scoresDataReturned:(NSArray *)returnedScores;

@end
